<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./CSS/reset.css">
    <style>
        .nav{
            /* background-color: #bfa; */
            width: 320px;
            /* height: 137px; */
            margin: 100px auto;
            text-align: center;
        }
        .nav li {
            float: left;
            position: relative;
        }
        .nav li a{
            color:rgb(98, 98, 100);
            width: 80px;
            display: block;
            text-decoration: none;
        }
        .nav li ul{
            width: 78px;
            height: 95px;
            position: absolute;
            border: 1px solid #FF8400;
            border-top: none;
        }
        .nav ul li{
            font-size: 14px;
            width: 78px;
            height: 31px;
            border-bottom: 1px solid #FF8400;
            line-height: 31px;
        }
        .nav ul{
            display: none;
        }
    </style>
</head>
<body>
    <ul class="nav">
        <li>
            <a href="javascript:;">微博</a>
            <ul>
                <li>私信</li>
                <li>评论</li>
                <li>@我</li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">微博</a>
            <ul>
                <li>私信</li>
                <li>评论</li>
                <li>@我</li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">微博</a>
            <ul>
                <li>私信</li>
                <li>评论</li>
                <li>@我</li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">微博</a>
            <ul>
                <li>私信</li>
                <li>评论</li>
                <li>@我</li>
            </ul>
        </li>

    </ul>
    <script>
        //鼠标滑过，弹出隐藏层,先拿到nav
        var nav = document.querySelector('.nav');
        //拿到nav下的所有li
        var lis = nav.children;
        for(var i = 0;i < lis.length;i++){
            lis[i].onmouseover = function(){
                this.children[1].style.display = 'block';
            }
            lis[i].onmouseout = function(){
                this.children[1].style.display = 'none';
            }
        }

    </script>
</body>
</html>